
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta charset="utf-8">
<meta name="viewport" content=" width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta name="copyright" content="http://www.appcms.org" />
<link href="../../../../statics/css/touch/base.css" rel="stylesheet" type="text/css">
<link href="../../../../statics/css/touch/index.css" rel="stylesheet" type="text/css">
<script src="js/config.js"></script>
<script src="js/common.js"></script>
<script src="js/zy_control.js"></script>
<script src="js/zy_click.js"></script>
<script src="js/login.js"></script>
</head>
<body ontouchstart>
<div id="main">
  <div id="header">
    <header><script>setHead('index',l_common['app_name']);</script></header>
  </div>
  <div id="content">
    <div id="main" class="">
      <div id="focuspic">
        <div id="slider" class="box-hor box" style="-webkit-transform: translate(0px, 0); -webkit-transition: 500ms;">
          <div class="loadimg" ontouchstart="zy_touch('down')"><img src="http://www.zuiqianduan.cn/uploadfile/2013/1206/20131206114737565.jpg" onclick="jump('news','1066','8','进京招商 贵阳白富美京城牵手高富帅')" class="" onload="this.className=''"></div>
        </div>
        <div id="switch" class="t-c"><em class="focus"></em><em class=""></em></div>
      </div>
      <ul class="ma">
        <li onclick="open_index('content');">
          <div><img src="skin/images/index/content.png"><span>贵阳热点</span></div>
        </li>
        <li onclick="open_index('talk');">
          <div><img src="skin/images/index/talk.png"><span>喷水池</span></div>
        </li>
        <li onclick="open_index('activity');">
          <div><img src="skin/images/index/activity.png"><span>潮活动</span></div>
        </li>
        <li onclick="open_index('coupons');">
          <div><img src="skin/images/index/coupons.png"><span>优惠券</span></div>
        </li>
        <li onclick="open_index('business');">
          <div><img src="skin/images/index/business.png"><span>吃喝玩乐</span></div>
        </li>
        <li onclick="open_index('apps');">
          <div><img src="skin/images/index/apps.png"><span>百宝箱</span></div>
        </li>
      </ul>
      <div class="mb">
        <div id="img" class="loadimg" onclick="javascript:jump('news','960','8','爱心接力 2013&quot;新年新衣&quot;贵州区启动');"><img src="http://www.zuiqianduan.cn/uploadfile/2013/1121/20131121115421157.jpg" class="" onload="this.className=''"></div>
      </div>
      <div class="mc" id="headlines" onclick="javascript:jump('news','1465','8','省十二届人大二次会议隆重开幕');">
        <div class="l"><img src="skin/images/index/jrrd.png"></div>
        <div class="r"><strong id="headlines_title">省十二届人大二次会议隆重开幕</strong>
          <p id="headlines_des">省长陈敏尔代表省人民政府向大会作《政府工作报告》。《报告》分为三大部分：一、</p>
        </div>
      </div>
    </div>
  </div>
  <div id="footer">
    <ul>
      <script>setFooter('index');</script>
    </ul>
  </div>
</div>
</body>
<script>
    	zy_init();
		var Users= new Users({});
		function loadindex(){	
			zy_con("content", "index_content.html", 0, $$("header").offsetHeight);
			window.onorientationchange=window.onresize=function(){
				zy_resize("content",0,$$("header").offsetHeight);				
			}
			//检查更新
			var url = app_path+'index.php?m=iapp&c=app&a=upgrade&ver='+version+'&platform='+localStorage['device'];
			uexXmlHttpMgr.open(1,'post',url,"8000");
			uexXmlHttpMgr.send(1);
		}
		
		function welcomeok(){
			location.reload();
		}
		
		function loadwelcome(){
			uexWindow.open('welcome','0','index_welcome.html','0','', '',4);
		}
		
		function openuser(windowname){
			if(!Users.checkUser()){
				windowname='login';
				localStorage['login']="root";
			}
			uexWindow.open(windowname, '0', windowname+'.html', 2, '', '', 0x0);
		}
		
        window.uexOnload = function(type){
            if (!type) {
				uexXmlHttpMgr.onData = function(opId, status, data){
					uexXmlHttpMgr.close(opId);
					if (status == 1) {
						data=JSON.parse(data);
						if(opId==1){
							if (data['success'] == 'yes') {
								uexWindow.confirm('软件更新', data['msg'], ["更新", "稍后"]);
								uexWindow.cbConfirm = function(cbopId, dataType, cbdata){
									if (cbdata == 0) {
										if (localStorage['device'] == 0) {
											loadLink(data['data']['iphone_updateFileUrl']);
										}else if (localStorage['device'] == 1) {
											loadLink(data['data']['android_File']);
										}
									}else {
										return;
									}
								}
							}
						}else if(opId==2){
							if (data['success'] == 'yes') {
								localStorage['skin'] = data['data']['skin'];
							}
						}
					}else if(status==-1){
						uexXmlHttpMgr.close(opId);
						uexWindow.toast("0","5",'加载失败',1000);
					}
				}
				
				if(typeof(localStorage['version']) != "undefined" && localStorage['version'] == version){
					loadindex();
				}else{
					loadwelcome();
				}
				
								
				//推送开始
				//注册应用运行中Push事件通知函数
				uexWidget.setPushNotifyCallback("cbNotify");
				//注册获取硬件信息回调函数
				uexDevice.cbGetInfo = function(opCode, dataType, data){
					//alert("deviceToken=" + data);
				}
				//绑定当前用户信息到AppCan推送服务器
				setdeviceToken();
				//获取当前应用的DeviceToken
				uexDevice.getInfo('11');
				//注册获取Push消息内容的回调函数
				uexWidget.cbGetPushInfo = function(opCode, dataType, data){
					if(data){
						data = eval('('+data+')');
						var id = data['id'];
						var t = data['model'];
						var catid = data['catid'];
			
						if (data['id'] == 0) {
							return false;
						}
						if(t=='news'||t=='picture'||t=='video'){			
							localStorage[t+'_id']=id;
							localStorage[t+'_catid']=catid;
							uexWindow.open(t+'_item','0',t+'_item.html','2','', '',0);
				
						}else if(t=='business'){			
							localStorage['business_id']=id;
							localStorage['business_catid']=catid;
							localStorage['business_name']=title;
							uexWindow.open('business_item','0','business_item.html','2','', '',0);
				
						}else if(t=='apps'){
							uexWindow.open('apps_'+id,'0','apps/'+id+'/index.html','2','', '',0);
						}else if(t=='appurl'){
							app(id,title);
						}else if(t=='url'){
							localStorage['browserurl']=data['url'];
							uexWindow.open('browser','0','browser.html','2','', '',4);
						}
					}
				}
				//获取应用由Push激活时的Push消息内容
				uexWidget.getPushInfo();
            }
        }
		
		function setdeviceToken(){
	 		uexWidget.setPushInfo("windeidolon","");
		}

		function cbNotify(){
			uexWidget.getPushInfo();
		}
    </script>
</html>